<template>
    <view>
        <view class="banner-box">
        	<image src="/static/stu/star-banner.png" mode="widthFix"></image>
			<view class="total-point">
				<text>当前总分</text>
				<view class="number">
					<text>{{starDetails.zScore}}</text>
				</view>
			</view>
        </view>
		<view class="details">
			<view class="title">
				<text>月度之星详情</text>
			</view>
			<view class="item" v-for="item in list" :key="item.id">
				<view class="desc">
					<text>{{item.name}}</text>
					<text class="tips">{{item.tips}}</text>
				</view>
				<text class="point">{{starDetails[item.type]}}积分</text>
			</view>
		</view>
    </view>
</template>
<script>
export default {
    data() {
        return {
			list: [{name: '积分', tips: '总积分', type: 'scoreCount', id: 1}, {name: '教师推荐', tips: '每被教师推荐次数一次加5分', type: 'recommendMark', id: 2}, {name: '发帖/回复', tips: '每次发布内容或评论加2分', type: 'addMark', id: 3}], // 获得积分类型
			studentId: '', // 学生的账号id
			starDetails: {} // 月度之星详情
        }
    },
	onLoad(options){
		this.studentId = options.accountId
		this.getMonthStarDetails()
	},
	methods: {
		// 用户月度之星详情
		getMonthStarDetails(){
			this.api.get('statistics/monthStarDetails', {
				accountId: this.studentId
			}).then(res => {
				if(res.data.state == 'ok'){
					this.starDetails = res.data;
				}
			})
		},
	}
}
</script>
<style lang="less" scoped>
	.banner-box{
		position: relative;
		padding-top: 20rpx;
		margin: 0 24rpx;
		image{
			width: 100%;
		}
	}
	.total-point{
		position: absolute;
		top: 55rpx;
		left: 34rpx;
		color: #fff;
		font-size: 32rpx;
		line-height: 45rpx;
		.number{
			margin-top: 26rpx;
			lighting-color: 48rpx;
			font-weight: bold;
			font-size: 42rpx;
		}
	}
	.details{
		margin: 60rpx 24rpx 0;
	}
	.title{
		font-size: 30rpx;
		font-weight: bold;
		line-height: 42rpx;
		padding-bottom: 20rpx;
	}
	.item{
		margin: 36rpx 8rpx 0;
		display: flex;
		justify-content: space-between;
		align-items: flex-start;
		line-height: 38rpx;
		font-weight: bold;
		color: #162641;
		font-size: 30rpx;
		position: relative;
		padding-bottom: 24rpx;
		&::after{
			position: absolute;
			content: '';
			left: 0;
			bottom: 0;
			width: 200%;
			height: 2rpx;
			background-color: #F0F0F0;
			transform: scale(0.5) translateX(-50%);
		}
		.point{
			font-size: 32rpx;
			color: #28C2CD;
		}
	}
	.tips{
		margin-top: 24rpx;
		display: block;
		font-size: 26rpx;
		color: #999999;
		font-weight: normal;
	}
</style>